document.querySelector('.scroll-wrapper').addEventListener('touchmove', function(e) {
  const el = e.currentTarget;
  const isTop = el.scrollTop === 0;
  const isBottom = el.scrollTop + el.clientHeight === el.scrollHeight;

  if ((e.deltaY < 0 && isTop) || (e.deltaY > 0 && isBottom)) {
    e.preventDefault();
  }
}, { passive: false });
